package com.qijian.maindata.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qijian.common.annotation.Excel;
import com.qijian.common.annotation.KingDeeField;
import com.qijian.common.core.domain.BaseEntity;
import com.qijian.tool.domain.Storage;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.constraints.NotBlank;

/**
 * 通用树形分类对象 sys_classify
 *
 * @author qijian
 * @date 2021-12-23
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
@TableName("sys_classify")
public class CommonClassify extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 唯一id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "唯一id")
    @KingDeeField("FID")
    private Long id;

    /**
     * 分类
     */
    @Excel(name = "分类")
    @ApiModelProperty(value = "分类")
    @NotBlank(message = "分类不允许为空")
    private String classifyType;

    @Excel(name = "祖级列表")
    @ApiModelProperty(value = "祖级列表")
    private String ancestors;

    /**
     * 编码
     */
    @Excel(name = "编码")
    @ApiModelProperty(value = "编码")
    @KingDeeField("FNumber")
    private String code;

    /**
     * 名称
     */
    @Excel(name = "名称")
    @ApiModelProperty(value = "名称")
    @KingDeeField("FName")
    private String name;

    /**
     * 顶级分类id
     */
    @Excel(name = "顶级分类id")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "顶级分类id")
    private Long topClassifyId;

    /**
     * 父级分类id
     */
    @Excel(name = "父级分类id")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "父级分类id")
    @KingDeeField("FParentId")
    private Long parentClassifyId;

    @TableField(exist = false)
    private Storage files;

}
